home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _SQLite_Query.au3 < prev    next >
Text File  |  2007-09-08  |  813b  |  22 lines

  1. #include <SQLite.au3>
  2. #include <SQLite.dll.au3>
  3.  
  4. Local $hQuery, $aRow, $sMsg
  5. _SQLite_Startup ()
  6. _SQLite_Open () ; open :memory: Database
  7. _SQLite_Exec (-1, "CREATE TABLE aTest (a,b,c);") ; CREATE a Table
  8. _SQLite_Exec (-1, "INSERT INTO aTest(a,b,c) VALUES ('c','2','World');") ; INSERT Data
  9. _SQLite_Exec (-1, "INSERT INTO aTest(a,b,c) VALUES ('b','3',' ');") ; INSERT Data
  10. _SQLite_Exec (-1, "INSERT INTO aTest(a,b,c) VALUES ('a','1','Hello');") ; INSERT Data
  11. _SQlite_Query (-1, "SELECT c FROM aTest ORDER BY a;", $hQuery) ; the query
  12. While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK
  13.     $sMsg &= $aRow[0]
  14. WEnd
  15. _SQLite_Exec (-1, "DROP TABLE aTest;") ; Remove the table
  16. MsgBox(0,"SQLite","Get Data using a Query : " &  $sMsg )
  17. _SQLite_Close()
  18. _SQLite_Shutdown()
  19.  
  20. ;~ Output:
  21. ;~   
  22. ;~ Hello World